package com.example.shop.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.shop.entity.SearchShopCondition;
import com.example.shop.entity.Shop;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface ShopMapper extends BaseMapper<Shop> {

    default Page<Shop> search(SearchShopCondition condition) {
        LambdaQueryWrapper<Shop> queryWrapper = new LambdaQueryWrapper();
        return selectPage(condition.getPage(), queryWrapper);
    }

    default List<Shop> search(List<String> contSignList) {
        LambdaQueryWrapper<Shop> queryWrapper = new LambdaQueryWrapper();
        queryWrapper.in(Shop::getContSign,contSignList);
        return selectList(queryWrapper);
    }

}
